From: Daniel Carl <danielcarl@gmx.de>
Date: Fri, 21 Apr 2017 21:16:46 +0000 (+0200)
Subject: Don't warn about missing scripts file.
X-Git-Url: https://git.owens.tech/assets/lich_lifts_title_slice.png%20%22Lich%20Lifts%22/assets/lich_lifts_title_slice.png%20%22Lich%20Lifts%22/git?a=commitdiff_plain;h=fe0ace52d36043e93cef91720f41f1ef38f4dd0d;p=vimb.git

Don't warn about missing scripts file.

It's not required that the user has a scripts file. So don't attempt to
inject it if it is not present.
---

diff --git a/src/setting.c b/src/setting.c
index 6e1fcde..f0752e8 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -593,7 +593,9 @@ static int user_scripts(Client *c, const char *name, DataType type, void *value,
     ucm = webkit_web_view_get_user_content_manager(c->webview);
 
     if (enabled) {
-        if (g_file_get_contents(vb.files[FILES_SCRIPT], &source, NULL, NULL)) {
+        if (vb.files[FILES_SCRIPT]
+                && g_file_get_contents(vb.files[FILES_SCRIPT], &source, NULL, NULL)) {
+
             script = webkit_user_script_new(
                 source, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES,
                 WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END, NULL, NULL